import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/home',
        name: 'home',
        component: HomeView,
        children: [
            {
                path: '',
                component: () => import('@/views/News.vue')
            },
            {
                path: '/survey',
                component: () => import('@/views/Survey.vue')
            }
            ,
            {
                path: '/advisor',
                component: () => import('@/views/Advisor.vue')
            }
            ,
            {
                path: '/earnings',
                component: () => import('@/views/Profit.vue')
            }
            ,
            {
                path: '/news',
                component: () => import('@/views/News.vue')
            }
            , {
                path: '/search',
                component: () => import('@/views/Search.vue')
            },
            {
                path: '/admin',
                component: () => import('@/views/Admin.vue'),
            }
        ]
    },
    {
        path: '/',
        name: 'login',
        component: () => import('@/views/LoginView'),
        children: [
            {
                path: '',
                component: () => import('@/views/LoginView')
            },
        ]
    },
    {
        path: '/user',
        name: 'userview',
        component: () => import('@/views/UserView'),
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('@/views/RegisterView'),
    },


]

const router = new VueRouter({
    routes
})

export default router
